package com.fjzn.detect.config.mybatis;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * mybatis的扫描配置
 *
 * @author yzh
 * @since 2021年04月25日14:27:23
 */
@Configuration
@MapperScan({"com.fjzn.detect.repository.*.mapper*"})
public class MybatisPlusConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor page = new PaginationInterceptor();
        page.setDialectType("mysql");
        return page;
    }

    @Bean
    public MetaObjectHandler myMetaObjectHandler(){
        return new MyMetaObjectHandler();
    }


}
